<?php
namespace app\wechat\controller;

use think\Request;
use think\Db;
use external\SFTools;
use DateTime;

class Entrance {
    public function index(){
        $page = 1;
        $size = 3;
        $list = Db::connect('oracle_config')->table('F3002')->field('IXKITA,IXAITM')->page($page, $size)->select();
        print_r($list);
    }
    
    public function index2(){
        $list = Db::connect('oracle_config')->table('F3002')->field('IXKITA,IXAITM')->where('IXKITA', 'LIKE', 'CSDBF030003%')->group('IXKITA,IXAITM')->select();
        print_r($list);
    }
    
    public function index3(){
        $list = Db::connect('oracle_config')->table('F3002')->field('IXKITA,IXAITM')->whereRaw("trim(IXKITA) = 'CSDBF030003'")->select();
        print_r($list);
    }
    
    public function excel(){
        $columns = array('A', 'B', 'C', 'D', 'E', 'F'); //容器
        $title = array(array('uuid', 'A1标题'), array('B', 'B1标题'), array('C', 'C1标题'), array('D', 'D1标题'), array('E', 'E1标题'), array('F', 'F1标题')); //标题
        $data = array( //内容
            array('uuid' => 'A2内容', 'B' => '', 'C' => 'C2内容', 'D' => '', 'E' => 'E2内容', 'F' => 'F2内容'),
            array('uuid' => 'A3内容', 'B' => '', 'C' => 'C3内容', 'D' => '', 'E' => 'E3内容', 'F' => 'F3内容'),
            array('uuid' => 'A4内容', 'B' => 'B4内容', 'C' => '', 'D' => 'D4内容', 'E' => 'E4内容', 'F' => ''),
        );
        $excel = new \external\Excel();
        $excel->exportExcel($columns, $title, $data);
    }
}
